import 'dart:async';
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:image_picker/image_picker.dart';
import 'package:flutter/services.dart';
// import 'package:wis_flutter/bottomBar.dart';     // 底部导航条



// 测试页面
class TestPage extends StatefulWidget {
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<TestPage> {

  final FocusScopeNode _node = FocusScopeNode();
  final GlobalKey<FormState> _formKey = GlobalKey<FormState>();

  @override
  void dispose() {
    // _node.dispose();
    super.dispose();
  }


  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('图片选择器的例子222111'),
      ),
      body: Form(
      key: _formKey,
      child: FocusScope(
        node: _node,
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: <Widget>[
            // email
                TextFormField(
                  decoration: InputDecoration(
                    labelText: 'Email',
                  ),
                  inputFormatters: [
                    WhitelistingTextInputFormatter(RegExp("(?!(0.00|00.00))(1[0-5]|0[0-9]|[0-9])(?:\.([0-9]{1,2}))")),//只允许输入小数
                    // WhitelistingTextInputFormatter(RegExp("[a-zA-Z]")),//只允许输入字母
                  ],                  

                ),
                // password
                TextFormField(
                  decoration: InputDecoration(
                    labelText: 'Password',
                  ),
                  obscureText: true,
                  textInputAction: TextInputAction.done,
                  // move to the next field
                  onEditingComplete: _node.nextFocus,
                ),
                // submit
                RaisedButton(
                  child: Text('Sign In'),
                  onPressed: () {/* submit code here */},
                ),
              ],
          ),
      
        )
      )
    );
  }
}



